/** When your routing table is too long, you can split it into small modules **/

import Layout from '@/layout'

const demoRouter = [
  {
    path: '/admin/member_manage',
    name: 'AdminMemberManage',
    meta: {
      title: '会员管理',
      icon: 'el-icon-s-custom',
      routes: [
        'admin/member/list'
      ]
    },
    redirect: 'noRedirect',
    component: Layout,
    alwaysShow: true,
    children: [
      {
        path: '/admin/member',
        name: 'AdminMember',
        meta: {
          title: '会员列表',
          routes: ['admin/member/list']
        },
        component: () => import('@/views/admin/member/list')
      },
      {
        path: '/admin/member/chart',
        name: 'AdminMemberChart',
        meta: {
          title: '会员统计',
          routes: ['admin/member/chart']
        },
        component: () => import('@/views/admin/member/chart')
      }
    ]
  },
  {
    path: '/admin/setting_manage',
    name: 'AdminSettingManage',
    meta: {
      title: '设置',
      icon: 'el-icon-setting',
      routes: [
        'admin/province/list',
        'admin/city/list',
        'admin/district/list',
        'admin/database/list',
        'admin/setting/clearCache'
      ]
    },
    redirect: 'noRedirect',
    component: Layout,
    alwaysShow: true,
    children: [
      {
        path: '/admin/region_group',
        name: 'AdminRegionGroup',
        meta: {
          title: '区域管理',
          icon: 'el-icon-location',
          routes: [
            'admin/province/list',
            'admin/city/list',
            'admin/district/list'
          ]
        },
        redirect: '/admin/province/list',
        component: () => import('@/views/admin/nested/index'), // 嵌套（原则上有多少级路由嵌套就需要多少个<router-view>）
        children: [
          {
            path: '/admin/province',
            name: 'AdminProvince',
            meta: {
              title: '省级管理',
              routes: ['admin/province/list']
            },
            component: () => import('@/views/admin/region/list')
          },
          {
            path: '/admin/city',
            name: 'AdminCity',
            meta: {
              title: '市级管理',
              routes: ['admin/city/list']
            },
            component: () => import('@/views/admin/region/list')
          },
          {
            path: '/admin/district',
            name: 'AdminDistrict',
            meta: {
              title: '区级管理',
              routes: ['admin/district/list']
            },
            component: () => import('@/views/admin/region/list')
          }
        ]
      },
      {
        path: '/admin/database_group',
        name: 'AdminDatabaseGroup',
        meta: {
          title: '数据库管理',
          icon: 'el-icon-coin',
          routes: [
            'admin/database/export',
            'admin/database/import'
          ]
        },
        redirect: '/admin/database/export',
        component: () => import('@/views/admin/nested/index'), // 嵌套
        children: [
          {
            path: '/admin/database/export',
            name: 'AdminDatabaseExport',
            meta: {
              title: '数据库备份',
              routes: ['admin/database/export']
            },
            component: () => import('@/views/admin/admin/index')
          },
          {
            path: '/admin/database/import',
            name: 'AdminDatabaseImport',
            meta: {
              title: '数据库还原',
              routes: ['admin/database/import']
            },
            component: () => import('@/views/admin/admin/index')
          }
        ]
      },
      {
        path: 'profile',
        name: 'AdminProfile',
        meta: {
          title: '清理缓存',
          routes: ['admin/admin.Admin/profile']
        },
        component: () => import('@/views/admin/admin/profile')
      }
    ]
  },
  {
    path: '/admin/menu_manage',
    name: 'AdminMenuManage',
    meta: {
      title: '菜单管理',
      icon: 'el-icon-menu',
      routes: [
        'admin/menu/list'
      ]
    },
    redirect: 'noRedirect',
    component: Layout,
    alwaysShow: true,
    children: [
      {
        path: '/admin/menu',
        name: 'AdminMenu',
        meta: {
          title: '后台菜单',
          routes: ['admin/menu/list']
        },
        component: () => import('@/views/admin/menu/list')
      }
    ]
  },
  {
    path: '/admin/cms_manage',
    name: 'AdminCmsManage',
    meta: {
      title: '内容管理',
      icon: 'el-icon-reading',
      routes: [
        'admin/article_cate/list',
        'admin/article/list'
      ]
    },
    redirect: 'noRedirect',
    component: Layout,
    alwaysShow: true,
    children: [
      {
        path: '/admin/article_cate',
        name: 'AdminArticleCate',
        meta: {
          title: '分类管理',
          routes: ['admin/article_cate/list']
        },
        component: () => import('@/views/admin/category/list')
      },
      {
        path: '/admin/article',
        name: 'AdminArticle',
        meta: {
          title: '文章管理',
          routes: ['admin/admin.Admin/profile']
        },
        component: () => import('@/views/admin/article/list')
      }
    ]
  },
  {
    path: '/admin/file',
    component: Layout,
    children: [
      {
        path: '/admin/file',
        name: 'AdminFile',
        component: () => import('@/views/admin/file/list'),
        meta: {
          title: '文件管理',
          icon: 'el-icon-s-flag',
          routes: ['admin/file/list']
        }
      },
    ]
  },
]
export default demoRouter
